<?php
class getSocialInfo extends ActionHandler
{
 	function handleRequest($jsonData)
	{
 		$data = $jsonData['params'];
		$ownerId = $data['ownerId'];
		$sql = "select a.type,a.userId,a.buildingId,a.heightChange,a.populationChange,a.date,a.viewed,b.name as userName from ".$this->tables['social_profile']." a Left Join ".$this->tables['user_profile']." b On a.userId = b.id where a.ownerId = ".$ownerId." ORDER BY date DESC limit 0, 30";
		$return = array();
		$i = 0;
		$result = $this->db->query($sql);
		while($arr = $this->db->fetchArray($result))
		{
			$return['socialInfo'][$i++] = $arr;
		}
		return $return;	
 	}
}
?>
